package cn.source.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.system.mapper.MyFavoriteMapper;
import cn.source.system.domain.MyFavorite;
import cn.source.system.service.IMyFavoriteService;

/**
 * 收藏夹Service业务层处理
 * 
 * @author sourcebyte.vip
 * @date 2024-06-21
 */
@Service
public class MyFavoriteServiceImpl implements IMyFavoriteService 
{
    @Autowired
    private MyFavoriteMapper myFavoriteMapper;

    /**
     * 查询收藏夹
     * 
     * @param id 收藏夹主键
     * @return 收藏夹
     */
    @Override
    public MyFavorite selectMyFavoriteById(Long id)
    {
        return myFavoriteMapper.selectMyFavoriteById(id);
    }

    /**
     * 查询收藏夹列表
     * 
     * @param myFavorite 收藏夹
     * @return 收藏夹
     */
    @Override
    public List<MyFavorite> selectMyFavoriteList(MyFavorite myFavorite)
    {
        return myFavoriteMapper.selectMyFavoriteList(myFavorite);
    }

    /**
     * 新增收藏夹
     * 
     * @param myFavorite 收藏夹
     * @return 结果
     */
    @Override
    public int insertMyFavorite(MyFavorite myFavorite)
    {
        return myFavoriteMapper.insertMyFavorite(myFavorite);
    }

    /**
     * 修改收藏夹
     * 
     * @param myFavorite 收藏夹
     * @return 结果
     */
    @Override
    public int updateMyFavorite(MyFavorite myFavorite)
    {
        return myFavoriteMapper.updateMyFavorite(myFavorite);
    }

    /**
     * 批量删除收藏夹
     * 
     * @param ids 需要删除的收藏夹主键
     * @return 结果
     */
    @Override
    public int deleteMyFavoriteByIds(Long[] ids)
    {
        return myFavoriteMapper.deleteMyFavoriteByIds(ids);
    }

    /**
     * 删除收藏夹信息
     * 
     * @param id 收藏夹主键
     * @return 结果
     */
    @Override
    public int deleteMyFavoriteById(Long id)
    {
        return myFavoriteMapper.deleteMyFavoriteById(id);
    }
    
    /**
     * 删除收藏夹
     * 
     * @param id 收藏夹主键
     * @return 结果
     */
    public int deleteMyFavoriteByIdAndUserId(MyFavorite myFavorite) {
    	return myFavoriteMapper.deleteMyFavoriteByIdAndUserId(myFavorite);
    }
}
